<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:c="http://java.sun.com/jsp/jstl/core">
    <ui:composition template="templatecustomer.xhtml">
        <ui:define name="pagename">
            Car Rental
        </ui:define>
        <ui:define name="content">
            <h1 style="text-decoration: underline">CAR RENTAL SHOPPING CART</h1>
            <br/>
            <h:form>
                <ui:repeat value="#{carBean.cartCar}" var="cart">
                    <table>
                        <tr>
                            <td><img src="../admin/#{cart.carImg}" alt="images" width="150px" height="150px"/></td>
                            <td>
                                <table>
                                    <tr>
                                        <td width="130px"><b>Car Name :  </b></td>
                                        <td>#{cart.carName}</td>
                                    </tr>
                                    <tr>
                                        <td><b>Price :  </b></td>
                                        <td>#{cart.price}$</td>
                                    </tr>
                                    <tr>
                                        <td><b>Quantity :</b></td>
                                        <td><h:inputText id="QuantityCar" value="#{cart.quantity}"></h:inputText></td>
                                    </tr>
                                    <tr>
                                        <td><b>Pick Up:</b> </td>
                                        <td><p:calendar pattern="MM-dd-yyyy" value="#{cart.pickUp}"></p:calendar></td>
                                    </tr>
                                    <tr>
                                        <td><b>Drop Off: </b></td>
                                        <td><p:calendar pattern="MM-dd-yyyy" value="#{cart.dropOff}"></p:calendar></td>
                                    </tr>
                                    <tr>
                                        <td><b>Driver: </b></td>
                                        <td><h:selectBooleanCheckbox value="#{cart.driver}"></h:selectBooleanCheckbox></td>
                                    </tr>
                                    <tr>
                                        <td><h:commandButton style="background-image: url(images/cancel.png);width: 80px;height: 34px" action="#{carBean.actionRemoveCarInCart(cart.carID)}"></h:commandButton></td>
                                        <td></td>
                                    </tr>
                                </table>
                                <br/>
                            </td>
                        </tr>
                    </table>
                    <br/>
                </ui:repeat>
                <c:if test="#{carBean.cartCar.size() != 0}">
                    <b style="color: navy">Total: #{carBean.total}$</b>
                    <br></br><br></br><br></br>
                    <h:commandButton style="background-image: url(images/update.png);width: 80px;height: 34px" action="#{carBean.actionUpdateCart}"></h:commandButton>
                    <br></br><br></br>
                    <h:commandButton value="Review Order" action="#{carBean.actionReview}"></h:commandButton>
                </c:if>
                <c:if test="#{carBean.cartCar.size() == 0}">
                    <br/>
                    <b>NOT HAVE ANY PRODUCTS IN YOUR SHOPPING CART</b>
                </c:if>
            </h:form>
        </ui:define>
    </ui:composition>
</html>

